defmodule PrivateCandy do
	@moduledoc false

	require Logger


	def remind(env) do
		m = env.module
		l = env.line
		throw({:error, "#{m}_input_error_#{l}"})
	end

	def debug_remind(env, reason) do
		case Pango.RunMode.is_debug?() do
			true ->
				m = env.module
				l = env.line
				Logger.info("mod:#{inspect(m)}, line:#{inspect(l)}, reason:#{reason}")
				raise TipError, "mod:#{inspect(m)},line: #{l}, #{reason}"
			_ ->
				raise TipError, "input_error"
		end
	end

	def convert_list(value) do
		[value]
	end

	def not_null!(val) do
		val not in ["", nil] || debug_remind(__ENV__, "can't be nil or \"\"")
	end

end
